package com.dataporter.gather.bed;

import java.text.NumberFormat;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.dataporter.gather.patient.Patient;
import com.dataporter.gather.server.Temperature;
import com.touchwisdom.modular.common.entity.BaseEntity;

/**
 * 病人信息
 * 
 * @author ggeagle
 *
 */
@Table(name = "T_Bed")
@Entity
public class Bed extends BaseEntity {
	/**
	 * 姓名
	 */
	private String name;
	/**
	 * 床位的状态信息
	 */
	private String status;
	/**
	 * 体温信息
	 */
	@Transient
	private Patient patient;

	public Patient getPatient() {
		return patient;
	}

	public void setPatient(Patient patient) {
		this.patient = patient;
	}

	/**
	 * 体温信息
	 */
	@Transient
	private Temperature tiwen;

	public Temperature getTiwen() {
		return tiwen;
	}

	public String getTiwenValue() {
		NumberFormat nf = NumberFormat.getNumberInstance();
		nf.setMaximumFractionDigits(2);
		return nf.format(this.tiwen);
	}

	public void setTiwen(Temperature tiwen) {
		this.tiwen = tiwen;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
}